import { Component, Input, OnInit } from "@angular/core";
import { Pnode } from "src/app/@types/pnode";

@Component({
    selector: "condition-pnode",
    styles: [
        `
            :host ::ng-deep .btn-delete {
                width: 21px;
                height: 21px;
                position: absolute;
                right: 3px;
                top: -5px;
                visibility: hidden;
                z-index: 9;
                opacity: 0;
                transition: all 0.2s ease;
            }
            :host ::ng-deep .btn-delete img {
                width: 100%;
            }
            :host ::ng-deep.node-wrapper:hover .btn-delete {
                visibility: visible;
                opacity: 1;
            }
            :host ::ng-deep .ico-wrapper::after {
                transform: rotate(45deg) scale(0.8);
            }
            :host ::ng-deep .ico-wrapper img {
                width: 60%;
                border-radius: 50%;
            }
        `,
    ],
    template: `
        <ng-container [ngSwitch]="data.config.mode">
            <condition-pnode-time
                *ngSwitchCase="0"
                [data]="data"
            ></condition-pnode-time>
        </ng-container>
    `,
})
export class ConditionComponent implements OnInit {
    /** 节点数据 */
    @Input() data: Pnode;

    constructor() {}

    ngOnInit(): void {}
}
